{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ce30a1d7-8fd8-4018-bc33-458a4a59bac7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from utils import *\n",
    "import feature_extraction.ecgAutoencoder\n",
    "from torch.utils.data import Dataset, DataLoader\n",
    "from sklearn.model_selection import train_test_split\n",
    "import numpy as np\n",
    "import torch\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d4b815ac-8659-46af-b921-de564c97b806",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.cuda.is_available()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "fdf53d64-8a1b-4bf6-b24d-d618a498671b",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: Arial, Liberation Sans, Bitstream Vera Sans, sans-serif\n",
      "findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: Arial, Liberation Sans, Bitstream Vera Sans, sans-serif\n",
      "findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: Arial, Liberation Sans, Bitstream Vera Sans, sans-serif\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch: 1, Cumulative Loss: 50.160692\n",
      "Epoch: 2, Cumulative Loss: 34.217743\n",
      "Epoch: 3, Cumulative Loss: 31.233153\n",
      "Epoch: 4, Cumulative Loss: 26.506259\n",
      "Epoch: 5, Cumulative Loss: 36.419953\n",
      "Epoch: 6, Cumulative Loss: 30.182734\n",
      "Epoch: 7, Cumulative Loss: 27.429675\n",
      "Epoch: 8, Cumulative Loss: 21.916295\n",
      "Epoch: 9, Cumulative Loss: 19.845489\n",
      "Epoch: 10, Cumulative Loss: 21.198587\n",
      "Epoch: 11, Cumulative Loss: 20.671539\n",
      "Epoch: 12, Cumulative Loss: 18.911175\n",
      "Epoch: 13, Cumulative Loss: 23.835966\n",
      "Epoch: 14, Cumulative Loss: 26.381609\n",
      "Epoch: 15, Cumulative Loss: 22.980164\n",
      "Epoch: 16, Cumulative Loss: 22.299676\n",
      "Epoch: 17, Cumulative Loss: 19.325793\n",
      "Epoch: 18, Cumulative Loss: 22.245680\n",
      "Epoch: 19, Cumulative Loss: 22.556752\n",
      "Epoch: 20, Cumulative Loss: 21.755407\n",
      "Epoch: 21, Cumulative Loss: 21.120143\n",
      "Epoch: 22, Cumulative Loss: 21.388171\n",
      "Epoch: 23, Cumulative Loss: 18.182864\n",
      "Epoch: 24, Cumulative Loss: 17.476973\n",
      "Epoch: 25, Cumulative Loss: 19.999272\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEWCAYAAABhffzLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABECUlEQVR4nO3dd3gU1frA8e/upocSAknohrbHDhrAih1Urv0qdhFF/XktKCiCIiBIFcVy7YqCih296hULKAqKygYBRXwFBOkpkFACSUgyvz9mcg2QsgnZ3ST7fp5nn2w55d1M8u7smTNnXJZloZRSKny4Qx2AUkqp4NLEr5RSYUYTv1JKhRlN/EopFWY08SulVJjRxK+UUmFGE78KO8YYyxjTOdRxVMYYc78x5qXaLqsUgEvn8SsAY8w8oCvQUkQKqlHPArqIyKpAxVbbAhWzMWY20Mt5GA1YQKHz+HUR+b/a7C8Y6uP2VVWLCHUAKvSMManYCWs7cAHwbkgDqqOMMREiUlTR6yJybpmyrwIbRGREddt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pSugeh1K294wxZadzDnR+FhhjvsNeLfIW5/oGGGOuBWY6a9FnAdcAiMg3xpgJwBxjTAn2Xv75wXoTSvlDV+dUqgLOrJ7G8vc1kpVqEHSoRymlwozu8SulVJjRPX6llAozmviVUirMaOJXSqkwo4lfKaXCjCZ+pZQKM/8POiDZDfhdfS8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Define your ECG dataset\n",
    "class ECGDataset(Dataset):\n",
    "    def __init__(self, ecgs):\n",
    "        self.ecg = ecgs\n",
    "\n",
    "    def __len__(self):\n",
    "        return len(self.ecg)\n",
    "\n",
    "    def __getitem__(self, index):\n",
    "        return torch.tensor(self.ecg[index], dtype=torch.float32)\n",
    "\n",
    "\n",
    "X, y, Y = label_ecgs(data_dir='/data/physionet/', sampling_rate=100)\n",
    "labels = y.to_numpy()\n",
    "\n",
    "# Test train split\n",
    "X_train, X_test, labels_train, labels_test, Y_train, Y_test = train_test_split(X, labels, Y, test_size=0.2, random_state=33)\n",
    "\n",
    "\n",
    "# Downsample the majority class\n",
    "\n",
    "# Get indices of majority class (out of labels_train)\n",
    "class_0_idx = np.where(labels_train == 0)[0]\n",
    "\n",
    "# Get indices of minority class (out of labels_train)\n",
    "class_1_idx = np.where(labels_train == 1)[0]\n",
    "\n",
    "# Sample from majority class\n",
    "unique, counts = np.unique(labels_train, return_counts=True)\n",
    "count_dic = dict(zip(unique, counts))\n",
    "n_samples = int(count_dic[1]*1.5)\n",
    "sampled_class_0_idx = np.random.choice(class_0_idx, size=n_samples, replace=False)\n",
    "\n",
    "# Merge the selected samples\n",
    "idx_sampled = np.concatenate([sampled_class_0_idx, class_1_idx])\n",
    "idx_sampled.sort()\n",
    "\n",
    "# Filter train and labels_train\n",
    "X_train = X_train[idx_sampled, :]\n",
    "labels_train = labels_train[idx_sampled]\n",
    "Y_train = Y_train.iloc[idx_sampled, :]\n",
    "\n",
    "np.count_nonzero(labels_train == 0)\n",
    "np.count_nonzero(labels_train == 1)\n",
    "\n",
    "X_train.shape\n",
    "labels_train.shape\n",
    "\n",
    "# Create train and test data loaders\n",
    "batch_size = 32\n",
    "train_dataset = ECGDataset(X_train)\n",
    "test_dataset = ECGDataset(X_test)\n",
    "train_dataloader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\n",
    "test_dataloader = DataLoader(test_dataset, batch_size=batch_size, shuffle=False)\n",
    "\n",
    "# Create the model\n",
    "model = feature_extraction.ecgAutoencoder.ECGAutoencoder(input_shape=(1000, 12))\n",
    "\n",
    "# Train the model\n",
    "model.fit(train_dataloader, num_epochs=25, learning_rate=0.01)\n",
    "\n",
    "\n",
    "# Save the model\n",
    "torch.save(model.state_dict(), 'data/model_data/autoencoder100.pth')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "f5de30a5-2027-472f-a0ba-5fb3c5ca8ad3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([7920, 12000])\n"
     ]
    }
   ],
   "source": [
    "train_ecgs = torch.stack([X.view(-1, 12*1000) for X in train_dataloader.dataset]).view(-1, 12*1000)\n",
    "\n",
    "print(train_ecgs.shape)\n",
    "\n",
    "# Get the latent space representation\n",
    "with torch.no_grad():\n",
    "    encoded_train = model.encoder(train_ecgs)\n",
    "\n",
    "encoded_train.shape\n",
    "\n",
    "encoded_train_df = pd.DataFrame(encoded_train.numpy())\n",
    "\n",
    "# Save the latent space representation\n",
    "#np.save('data/model_data/latent_space_train.npy', encoded_train_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "feb10944-8144-4436-adf0-613cbdfe982b",
   "metadata": {},
   "outputs": [],
   "source": [
    "test_ecgs = torch.stack([X.view(-1, 12*1000) for X in test_dataloader.dataset]).view(-1, 12*1000)\n",
    "\n",
    "test_ecgs.shape\n",
    "\n",
    "# Get the latent space representation\n",
    "with torch.no_grad():\n",
    "    encoded_test = model.encoder(test_ecgs)\n",
    "\n",
    "encoded_test.shape\n",
    "\n",
    "encoded_test_df = pd.DataFrame(encoded_test.numpy())\n",
    "\n",
    "# Save the latent space representation\n",
    "#np.save('data/model_data/latent_space_test.npy', encoded_test_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "8881b310-91aa-4b99-9824-dbc7a1b2b5f2",
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train = encoded_train_df\n",
    "x_train['target'] = labels_train\n",
    "\n",
    "x_test = encoded_test_df\n",
    "x_test['target'] = labels_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "bd265a43-8584-4935-aeed-aa68d8ed63e1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">\n",
       "#T_3b917_row9_col1 {\n",
       "  background-color: lightgreen;\n",
       "}\n",
       "</style>\n",
       "<table id=\"T_3b917_\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th class=\"blank level0\" >&nbsp;</th>\n",
       "      <th class=\"col_heading level0 col0\" >Description</th>\n",
       "      <th class=\"col_heading level0 col1\" >Value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
       "      <td id=\"T_3b917_row0_col0\" class=\"data row0 col0\" >Session id</td>\n",
       "      <td id=\"T_3b917_row0_col1\" class=\"data row0 col1\" >8415</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
       "      <td id=\"T_3b917_row1_col0\" class=\"data row1 col0\" >Target</td>\n",
       "      <td id=\"T_3b917_row1_col1\" class=\"data row1 col1\" >target</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
       "      <td id=\"T_3b917_row2_col0\" class=\"data row2 col0\" >Target type</td>\n",
       "      <td id=\"T_3b917_row2_col1\" class=\"data row2 col1\" >Binary</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
       "      <td id=\"T_3b917_row3_col0\" class=\"data row3 col0\" >Original data shape</td>\n",
       "      <td id=\"T_3b917_row3_col1\" class=\"data row3 col1\" >(11520, 67)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
       "      <td id=\"T_3b917_row4_col0\" class=\"data row4 col0\" >Transformed data shape</td>\n",
       "      <td id=\"T_3b917_row4_col1\" class=\"data row4 col1\" >(18720, 67)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
       "      <td id=\"T_3b917_row5_col0\" class=\"data row5 col0\" >Transformed train set shape</td>\n",
       "      <td id=\"T_3b917_row5_col1\" class=\"data row5 col1\" >(11520, 67)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
       "      <td id=\"T_3b917_row6_col0\" class=\"data row6 col0\" >Transformed test set shape</td>\n",
       "      <td id=\"T_3b917_row6_col1\" class=\"data row6 col1\" >(7200, 67)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
       "      <td id=\"T_3b917_row7_col0\" class=\"data row7 col0\" >Numeric features</td>\n",
       "      <td id=\"T_3b917_row7_col1\" class=\"data row7 col1\" >66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
       "      <td id=\"T_3b917_row8_col0\" class=\"data row8 col0\" >Rows with missing values</td>\n",
       "      <td id=\"T_3b917_row8_col1\" class=\"data row8 col1\" >63.6%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
       "      <td id=\"T_3b917_row9_col0\" class=\"data row9 col0\" >Preprocess</td>\n",
       "      <td id=\"T_3b917_row9_col1\" class=\"data row9 col1\" >True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row10\" class=\"row_heading level0 row10\" >10</th>\n",
       "      <td id=\"T_3b917_row10_col0\" class=\"data row10 col0\" >Imputation type</td>\n",
       "      <td id=\"T_3b917_row10_col1\" class=\"data row10 col1\" >simple</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row11\" class=\"row_heading level0 row11\" >11</th>\n",
       "      <td id=\"T_3b917_row11_col0\" class=\"data row11 col0\" >Numeric imputation</td>\n",
       "      <td id=\"T_3b917_row11_col1\" class=\"data row11 col1\" >mean</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row12\" class=\"row_heading level0 row12\" >12</th>\n",
       "      <td id=\"T_3b917_row12_col0\" class=\"data row12 col0\" >Categorical imputation</td>\n",
       "      <td id=\"T_3b917_row12_col1\" class=\"data row12 col1\" >mode</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row13\" class=\"row_heading level0 row13\" >13</th>\n",
       "      <td id=\"T_3b917_row13_col0\" class=\"data row13 col0\" >Fold Generator</td>\n",
       "      <td id=\"T_3b917_row13_col1\" class=\"data row13 col1\" >StratifiedKFold</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row14\" class=\"row_heading level0 row14\" >14</th>\n",
       "      <td id=\"T_3b917_row14_col0\" class=\"data row14 col0\" >Fold Number</td>\n",
       "      <td id=\"T_3b917_row14_col1\" class=\"data row14 col1\" >10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row15\" class=\"row_heading level0 row15\" >15</th>\n",
       "      <td id=\"T_3b917_row15_col0\" class=\"data row15 col0\" >CPU Jobs</td>\n",
       "      <td id=\"T_3b917_row15_col1\" class=\"data row15 col1\" >-1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row16\" class=\"row_heading level0 row16\" >16</th>\n",
       "      <td id=\"T_3b917_row16_col0\" class=\"data row16 col0\" >Use GPU</td>\n",
       "      <td id=\"T_3b917_row16_col1\" class=\"data row16 col1\" >False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row17\" class=\"row_heading level0 row17\" >17</th>\n",
       "      <td id=\"T_3b917_row17_col0\" class=\"data row17 col0\" >Log Experiment</td>\n",
       "      <td id=\"T_3b917_row17_col1\" class=\"data row17 col1\" >False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row18\" class=\"row_heading level0 row18\" >18</th>\n",
       "      <td id=\"T_3b917_row18_col0\" class=\"data row18 col0\" >Experiment Name</td>\n",
       "      <td id=\"T_3b917_row18_col1\" class=\"data row18 col1\" >clf-default-name</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_3b917_level0_row19\" class=\"row_heading level0 row19\" >19</th>\n",
       "      <td id=\"T_3b917_row19_col0\" class=\"data row19 col0\" >USI</td>\n",
       "      <td id=\"T_3b917_row19_col1\" class=\"data row19 col1\" >a4c5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0e657b90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from pycaret.classification import *\n",
    "\n",
    "exp_name = setup(\n",
    "    data = x_train,\n",
    "    target = 'target',\n",
    "    fold_strategy='stratifiedkfold',\n",
    "    test_data=x_test\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "bd7efe9f-6d92-4e00-a38b-61cefe5477aa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">\n",
       "#T_f4a67_ th {\n",
       "  text-align: left;\n",
       "}\n",
       "#T_f4a67_row0_col0, #T_f4a67_row0_col2, #T_f4a67_row0_col3, #T_f4a67_row0_col5, #T_f4a67_row0_col6, #T_f4a67_row0_col7, #T_f4a67_row1_col0, #T_f4a67_row1_col1, #T_f4a67_row1_col2, #T_f4a67_row1_col3, #T_f4a67_row1_col4, #T_f4a67_row1_col5, #T_f4a67_row1_col6, #T_f4a67_row1_col7, #T_f4a67_row2_col0, #T_f4a67_row2_col1, #T_f4a67_row2_col2, #T_f4a67_row2_col3, #T_f4a67_row2_col4, #T_f4a67_row2_col5, #T_f4a67_row2_col6, #T_f4a67_row2_col7, #T_f4a67_row3_col0, #T_f4a67_row3_col1, #T_f4a67_row3_col2, #T_f4a67_row3_col3, #T_f4a67_row3_col4, #T_f4a67_row3_col5, #T_f4a67_row3_col6, #T_f4a67_row3_col7, #T_f4a67_row4_col0, #T_f4a67_row4_col1, #T_f4a67_row4_col2, #T_f4a67_row4_col3, #T_f4a67_row4_col4, #T_f4a67_row4_col5, #T_f4a67_row4_col6, #T_f4a67_row4_col7, #T_f4a67_row5_col0, #T_f4a67_row5_col1, #T_f4a67_row5_col2, #T_f4a67_row5_col3, #T_f4a67_row5_col4, #T_f4a67_row5_col5, #T_f4a67_row5_col6, #T_f4a67_row5_col7, #T_f4a67_row6_col0, #T_f4a67_row6_col1, #T_f4a67_row6_col2, #T_f4a67_row6_col3, #T_f4a67_row6_col4, #T_f4a67_row6_col5, #T_f4a67_row6_col6, #T_f4a67_row6_col7, #T_f4a67_row7_col0, #T_f4a67_row7_col1, #T_f4a67_row7_col2, #T_f4a67_row7_col3, #T_f4a67_row7_col4, #T_f4a67_row7_col5, #T_f4a67_row7_col6, #T_f4a67_row7_col7, #T_f4a67_row8_col0, #T_f4a67_row8_col1, #T_f4a67_row8_col2, #T_f4a67_row8_col3, #T_f4a67_row8_col4, #T_f4a67_row8_col5, #T_f4a67_row8_col6, #T_f4a67_row8_col7, #T_f4a67_row9_col0, #T_f4a67_row9_col1, #T_f4a67_row9_col3, #T_f4a67_row9_col4, #T_f4a67_row9_col5, #T_f4a67_row10_col0, #T_f4a67_row10_col1, #T_f4a67_row10_col2, #T_f4a67_row10_col3, #T_f4a67_row10_col4, #T_f4a67_row10_col5, #T_f4a67_row10_col6, #T_f4a67_row10_col7, #T_f4a67_row11_col0, #T_f4a67_row11_col1, #T_f4a67_row11_col2, #T_f4a67_row11_col3, #T_f4a67_row11_col4, #T_f4a67_row11_col5, #T_f4a67_row11_col6, #T_f4a67_row11_col7, #T_f4a67_row12_col0, #T_f4a67_row12_col1, #T_f4a67_row12_col2, #T_f4a67_row12_col3, #T_f4a67_row12_col4, #T_f4a67_row12_col5, #T_f4a67_row12_col6, #T_f4a67_row12_col7, #T_f4a67_row13_col0, #T_f4a67_row13_col1, #T_f4a67_row13_col2, #T_f4a67_row13_col3, #T_f4a67_row13_col4, #T_f4a67_row13_col6, #T_f4a67_row13_col7, #T_f4a67_row14_col0, #T_f4a67_row14_col1, #T_f4a67_row14_col2, #T_f4a67_row14_col4, #T_f4a67_row14_col5, #T_f4a67_row14_col6, #T_f4a67_row14_col7 {\n",
       "  text-align: left;\n",
       "}\n",
       "#T_f4a67_row0_col1, #T_f4a67_row0_col4, #T_f4a67_row9_col2, #T_f4a67_row9_col6, #T_f4a67_row9_col7, #T_f4a67_row13_col5, #T_f4a67_row14_col3 {\n",
       "  text-align: left;\n",
       "  background-color: yellow;\n",
       "}\n",
       "#T_f4a67_row0_col8, #T_f4a67_row1_col8, #T_f4a67_row3_col8, #T_f4a67_row4_col8, #T_f4a67_row5_col8, #T_f4a67_row6_col8, #T_f4a67_row7_col8, #T_f4a67_row8_col8, #T_f4a67_row9_col8, #T_f4a67_row10_col8, #T_f4a67_row11_col8, #T_f4a67_row12_col8, #T_f4a67_row13_col8, #T_f4a67_row14_col8 {\n",
       "  text-align: left;\n",
       "  background-color: lightgrey;\n",
       "}\n",
       "#T_f4a67_row2_col8 {\n",
       "  text-align: left;\n",
       "  background-color: yellow;\n",
       "  background-color: lightgrey;\n",
       "}\n",
       "</style>\n",
       "<table id=\"T_f4a67_\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th class=\"blank level0\" >&nbsp;</th>\n",
       "      <th class=\"col_heading level0 col0\" >Model</th>\n",
       "      <th class=\"col_heading level0 col1\" >Accuracy</th>\n",
       "      <th class=\"col_heading level0 col2\" >AUC</th>\n",
       "      <th class=\"col_heading level0 col3\" >Recall</th>\n",
       "      <th class=\"col_heading level0 col4\" >Prec.</th>\n",
       "      <th class=\"col_heading level0 col5\" >F1</th>\n",
       "      <th class=\"col_heading level0 col6\" >Kappa</th>\n",
       "      <th class=\"col_heading level0 col7\" >MCC</th>\n",
       "      <th class=\"col_heading level0 col8\" >TT (Sec)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row0\" class=\"row_heading level0 row0\" >lda</th>\n",
       "      <td id=\"T_f4a67_row0_col0\" class=\"data row0 col0\" >Linear Discriminant Analysis</td>\n",
       "      <td id=\"T_f4a67_row0_col1\" class=\"data row0 col1\" >0.6555</td>\n",
       "      <td id=\"T_f4a67_row0_col2\" class=\"data row0 col2\" >0.5290</td>\n",
       "      <td id=\"T_f4a67_row0_col3\" class=\"data row0 col3\" >0.0148</td>\n",
       "      <td id=\"T_f4a67_row0_col4\" class=\"data row0 col4\" >0.6332</td>\n",
       "      <td id=\"T_f4a67_row0_col5\" class=\"data row0 col5\" >0.0288</td>\n",
       "      <td id=\"T_f4a67_row0_col6\" class=\"data row0 col6\" >0.0126</td>\n",
       "      <td id=\"T_f4a67_row0_col7\" class=\"data row0 col7\" >0.0523</td>\n",
       "      <td id=\"T_f4a67_row0_col8\" class=\"data row0 col8\" >0.3880</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row1\" class=\"row_heading level0 row1\" >ridge</th>\n",
       "      <td id=\"T_f4a67_row1_col0\" class=\"data row1 col0\" >Ridge Classifier</td>\n",
       "      <td id=\"T_f4a67_row1_col1\" class=\"data row1 col1\" >0.6539</td>\n",
       "      <td id=\"T_f4a67_row1_col2\" class=\"data row1 col2\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row1_col3\" class=\"data row1 col3\" >0.0065</td>\n",
       "      <td id=\"T_f4a67_row1_col4\" class=\"data row1 col4\" >0.5681</td>\n",
       "      <td id=\"T_f4a67_row1_col5\" class=\"data row1 col5\" >0.0129</td>\n",
       "      <td id=\"T_f4a67_row1_col6\" class=\"data row1 col6\" >0.0045</td>\n",
       "      <td id=\"T_f4a67_row1_col7\" class=\"data row1 col7\" >0.0269</td>\n",
       "      <td id=\"T_f4a67_row1_col8\" class=\"data row1 col8\" >0.7460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row2\" class=\"row_heading level0 row2\" >dummy</th>\n",
       "      <td id=\"T_f4a67_row2_col0\" class=\"data row2 col0\" >Dummy Classifier</td>\n",
       "      <td id=\"T_f4a67_row2_col1\" class=\"data row2 col1\" >0.6536</td>\n",
       "      <td id=\"T_f4a67_row2_col2\" class=\"data row2 col2\" >0.5000</td>\n",
       "      <td id=\"T_f4a67_row2_col3\" class=\"data row2 col3\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row2_col4\" class=\"data row2 col4\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row2_col5\" class=\"data row2 col5\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row2_col6\" class=\"data row2 col6\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row2_col7\" class=\"data row2 col7\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row2_col8\" class=\"data row2 col8\" >0.1680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row3\" class=\"row_heading level0 row3\" >lr</th>\n",
       "      <td id=\"T_f4a67_row3_col0\" class=\"data row3 col0\" >Logistic Regression</td>\n",
       "      <td id=\"T_f4a67_row3_col1\" class=\"data row3 col1\" >0.6532</td>\n",
       "      <td id=\"T_f4a67_row3_col2\" class=\"data row3 col2\" >0.5313</td>\n",
       "      <td id=\"T_f4a67_row3_col3\" class=\"data row3 col3\" >0.0048</td>\n",
       "      <td id=\"T_f4a67_row3_col4\" class=\"data row3 col4\" >0.4651</td>\n",
       "      <td id=\"T_f4a67_row3_col5\" class=\"data row3 col5\" >0.0094</td>\n",
       "      <td id=\"T_f4a67_row3_col6\" class=\"data row3 col6\" >0.0021</td>\n",
       "      <td id=\"T_f4a67_row3_col7\" class=\"data row3 col7\" >0.0130</td>\n",
       "      <td id=\"T_f4a67_row3_col8\" class=\"data row3 col8\" >1.3180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row4\" class=\"row_heading level0 row4\" >gbc</th>\n",
       "      <td id=\"T_f4a67_row4_col0\" class=\"data row4 col0\" >Gradient Boosting Classifier</td>\n",
       "      <td id=\"T_f4a67_row4_col1\" class=\"data row4 col1\" >0.6524</td>\n",
       "      <td id=\"T_f4a67_row4_col2\" class=\"data row4 col2\" >0.5254</td>\n",
       "      <td id=\"T_f4a67_row4_col3\" class=\"data row4 col3\" >0.0213</td>\n",
       "      <td id=\"T_f4a67_row4_col4\" class=\"data row4 col4\" >0.4569</td>\n",
       "      <td id=\"T_f4a67_row4_col5\" class=\"data row4 col5\" >0.0404</td>\n",
       "      <td id=\"T_f4a67_row4_col6\" class=\"data row4 col6\" >0.0105</td>\n",
       "      <td id=\"T_f4a67_row4_col7\" class=\"data row4 col7\" >0.0296</td>\n",
       "      <td id=\"T_f4a67_row4_col8\" class=\"data row4 col8\" >6.3160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row5\" class=\"row_heading level0 row5\" >ada</th>\n",
       "      <td id=\"T_f4a67_row5_col0\" class=\"data row5 col0\" >Ada Boost Classifier</td>\n",
       "      <td id=\"T_f4a67_row5_col1\" class=\"data row5 col1\" >0.6517</td>\n",
       "      <td id=\"T_f4a67_row5_col2\" class=\"data row5 col2\" >0.5257</td>\n",
       "      <td id=\"T_f4a67_row5_col3\" class=\"data row5 col3\" >0.0033</td>\n",
       "      <td id=\"T_f4a67_row5_col4\" class=\"data row5 col4\" >0.2883</td>\n",
       "      <td id=\"T_f4a67_row5_col5\" class=\"data row5 col5\" >0.0064</td>\n",
       "      <td id=\"T_f4a67_row5_col6\" class=\"data row5 col6\" >-0.0018</td>\n",
       "      <td id=\"T_f4a67_row5_col7\" class=\"data row5 col7\" >-0.0089</td>\n",
       "      <td id=\"T_f4a67_row5_col8\" class=\"data row5 col8\" >1.4960</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row6\" class=\"row_heading level0 row6\" >lightgbm</th>\n",
       "      <td id=\"T_f4a67_row6_col0\" class=\"data row6 col0\" >Light Gradient Boosting Machine</td>\n",
       "      <td id=\"T_f4a67_row6_col1\" class=\"data row6 col1\" >0.6429</td>\n",
       "      <td id=\"T_f4a67_row6_col2\" class=\"data row6 col2\" >0.5082</td>\n",
       "      <td id=\"T_f4a67_row6_col3\" class=\"data row6 col3\" >0.0724</td>\n",
       "      <td id=\"T_f4a67_row6_col4\" class=\"data row6 col4\" >0.4161</td>\n",
       "      <td id=\"T_f4a67_row6_col5\" class=\"data row6 col5\" >0.1223</td>\n",
       "      <td id=\"T_f4a67_row6_col6\" class=\"data row6 col6\" >0.0218</td>\n",
       "      <td id=\"T_f4a67_row6_col7\" class=\"data row6 col7\" >0.0358</td>\n",
       "      <td id=\"T_f4a67_row6_col8\" class=\"data row6 col8\" >0.4020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row7\" class=\"row_heading level0 row7\" >nb</th>\n",
       "      <td id=\"T_f4a67_row7_col0\" class=\"data row7 col0\" >Naive Bayes</td>\n",
       "      <td id=\"T_f4a67_row7_col1\" class=\"data row7 col1\" >0.6304</td>\n",
       "      <td id=\"T_f4a67_row7_col2\" class=\"data row7 col2\" >0.5268</td>\n",
       "      <td id=\"T_f4a67_row7_col3\" class=\"data row7 col3\" >0.1647</td>\n",
       "      <td id=\"T_f4a67_row7_col4\" class=\"data row7 col4\" >0.4177</td>\n",
       "      <td id=\"T_f4a67_row7_col5\" class=\"data row7 col5\" >0.2341</td>\n",
       "      <td id=\"T_f4a67_row7_col6\" class=\"data row7 col6\" >0.0487</td>\n",
       "      <td id=\"T_f4a67_row7_col7\" class=\"data row7 col7\" >0.0585</td>\n",
       "      <td id=\"T_f4a67_row7_col8\" class=\"data row7 col8\" >0.5180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row8\" class=\"row_heading level0 row8\" >xgboost</th>\n",
       "      <td id=\"T_f4a67_row8_col0\" class=\"data row8 col0\" >Extreme Gradient Boosting</td>\n",
       "      <td id=\"T_f4a67_row8_col1\" class=\"data row8 col1\" >0.6270</td>\n",
       "      <td id=\"T_f4a67_row8_col2\" class=\"data row8 col2\" >0.5148</td>\n",
       "      <td id=\"T_f4a67_row8_col3\" class=\"data row8 col3\" >0.1128</td>\n",
       "      <td id=\"T_f4a67_row8_col4\" class=\"data row8 col4\" >0.3754</td>\n",
       "      <td id=\"T_f4a67_row8_col5\" class=\"data row8 col5\" >0.1729</td>\n",
       "      <td id=\"T_f4a67_row8_col6\" class=\"data row8 col6\" >0.0148</td>\n",
       "      <td id=\"T_f4a67_row8_col7\" class=\"data row8 col7\" >0.0198</td>\n",
       "      <td id=\"T_f4a67_row8_col8\" class=\"data row8 col8\" >3.4780</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row9\" class=\"row_heading level0 row9\" >qda</th>\n",
       "      <td id=\"T_f4a67_row9_col0\" class=\"data row9 col0\" >Quadratic Discriminant Analysis</td>\n",
       "      <td id=\"T_f4a67_row9_col1\" class=\"data row9 col1\" >0.6194</td>\n",
       "      <td id=\"T_f4a67_row9_col2\" class=\"data row9 col2\" >0.5350</td>\n",
       "      <td id=\"T_f4a67_row9_col3\" class=\"data row9 col3\" >0.2233</td>\n",
       "      <td id=\"T_f4a67_row9_col4\" class=\"data row9 col4\" >0.4098</td>\n",
       "      <td id=\"T_f4a67_row9_col5\" class=\"data row9 col5\" >0.2887</td>\n",
       "      <td id=\"T_f4a67_row9_col6\" class=\"data row9 col6\" >0.0590</td>\n",
       "      <td id=\"T_f4a67_row9_col7\" class=\"data row9 col7\" >0.0641</td>\n",
       "      <td id=\"T_f4a67_row9_col8\" class=\"data row9 col8\" >0.5760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row10\" class=\"row_heading level0 row10\" >rf</th>\n",
       "      <td id=\"T_f4a67_row10_col0\" class=\"data row10 col0\" >Random Forest Classifier</td>\n",
       "      <td id=\"T_f4a67_row10_col1\" class=\"data row10 col1\" >0.5862</td>\n",
       "      <td id=\"T_f4a67_row10_col2\" class=\"data row10 col2\" >0.5094</td>\n",
       "      <td id=\"T_f4a67_row10_col3\" class=\"data row10 col3\" >0.2431</td>\n",
       "      <td id=\"T_f4a67_row10_col4\" class=\"data row10 col4\" >0.3569</td>\n",
       "      <td id=\"T_f4a67_row10_col5\" class=\"data row10 col5\" >0.2891</td>\n",
       "      <td id=\"T_f4a67_row10_col6\" class=\"data row10 col6\" >0.0120</td>\n",
       "      <td id=\"T_f4a67_row10_col7\" class=\"data row10 col7\" >0.0124</td>\n",
       "      <td id=\"T_f4a67_row10_col8\" class=\"data row10 col8\" >1.4340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row11\" class=\"row_heading level0 row11\" >knn</th>\n",
       "      <td id=\"T_f4a67_row11_col0\" class=\"data row11 col0\" >K Neighbors Classifier</td>\n",
       "      <td id=\"T_f4a67_row11_col1\" class=\"data row11 col1\" >0.5837</td>\n",
       "      <td id=\"T_f4a67_row11_col2\" class=\"data row11 col2\" >0.4970</td>\n",
       "      <td id=\"T_f4a67_row11_col3\" class=\"data row11 col3\" >0.2286</td>\n",
       "      <td id=\"T_f4a67_row11_col4\" class=\"data row11 col4\" >0.3470</td>\n",
       "      <td id=\"T_f4a67_row11_col5\" class=\"data row11 col5\" >0.2756</td>\n",
       "      <td id=\"T_f4a67_row11_col6\" class=\"data row11 col6\" >0.0005</td>\n",
       "      <td id=\"T_f4a67_row11_col7\" class=\"data row11 col7\" >0.0006</td>\n",
       "      <td id=\"T_f4a67_row11_col8\" class=\"data row11 col8\" >0.7720</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row12\" class=\"row_heading level0 row12\" >et</th>\n",
       "      <td id=\"T_f4a67_row12_col0\" class=\"data row12 col0\" >Extra Trees Classifier</td>\n",
       "      <td id=\"T_f4a67_row12_col1\" class=\"data row12 col1\" >0.5709</td>\n",
       "      <td id=\"T_f4a67_row12_col2\" class=\"data row12 col2\" >0.5105</td>\n",
       "      <td id=\"T_f4a67_row12_col3\" class=\"data row12 col3\" >0.2982</td>\n",
       "      <td id=\"T_f4a67_row12_col4\" class=\"data row12 col4\" >0.3569</td>\n",
       "      <td id=\"T_f4a67_row12_col5\" class=\"data row12 col5\" >0.3249</td>\n",
       "      <td id=\"T_f4a67_row12_col6\" class=\"data row12 col6\" >0.0142</td>\n",
       "      <td id=\"T_f4a67_row12_col7\" class=\"data row12 col7\" >0.0143</td>\n",
       "      <td id=\"T_f4a67_row12_col8\" class=\"data row12 col8\" >0.8920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row13\" class=\"row_heading level0 row13\" >dt</th>\n",
       "      <td id=\"T_f4a67_row13_col0\" class=\"data row13 col0\" >Decision Tree Classifier</td>\n",
       "      <td id=\"T_f4a67_row13_col1\" class=\"data row13 col1\" >0.5538</td>\n",
       "      <td id=\"T_f4a67_row13_col2\" class=\"data row13 col2\" >0.5075</td>\n",
       "      <td id=\"T_f4a67_row13_col3\" class=\"data row13 col3\" >0.3569</td>\n",
       "      <td id=\"T_f4a67_row13_col4\" class=\"data row13 col4\" >0.3564</td>\n",
       "      <td id=\"T_f4a67_row13_col5\" class=\"data row13 col5\" >0.3566</td>\n",
       "      <td id=\"T_f4a67_row13_col6\" class=\"data row13 col6\" >0.0151</td>\n",
       "      <td id=\"T_f4a67_row13_col7\" class=\"data row13 col7\" >0.0151</td>\n",
       "      <td id=\"T_f4a67_row13_col8\" class=\"data row13 col8\" >1.7980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th id=\"T_f4a67_level0_row14\" class=\"row_heading level0 row14\" >svm</th>\n",
       "      <td id=\"T_f4a67_row14_col0\" class=\"data row14 col0\" >SVM - Linear Kernel</td>\n",
       "      <td id=\"T_f4a67_row14_col1\" class=\"data row14 col1\" >0.5075</td>\n",
       "      <td id=\"T_f4a67_row14_col2\" class=\"data row14 col2\" >0.0000</td>\n",
       "      <td id=\"T_f4a67_row14_col3\" class=\"data row14 col3\" >0.5080</td>\n",
       "      <td id=\"T_f4a67_row14_col4\" class=\"data row14 col4\" >0.2931</td>\n",
       "      <td id=\"T_f4a67_row14_col5\" class=\"data row14 col5\" >0.2979</td>\n",
       "      <td id=\"T_f4a67_row14_col6\" class=\"data row14 col6\" >0.0126</td>\n",
       "      <td id=\"T_f4a67_row14_col7\" class=\"data row14 col7\" >0.0185</td>\n",
       "      <td id=\"T_f4a67_row14_col8\" class=\"data row14 col8\" >0.4220</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8e55dc8310>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Processing:   0%|          | 0/65 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "best_model = compare_models(fold=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "19072a97-3f64-4c35-802b-b98d64053a6f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Get the latent space representation\n",
    "with torch.no_grad():\n",
    "    decoded = model.decoder(encoded_train[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "f7dd497b-ccf8-434a-8d30-cbe7ca4a7a14",
   "metadata": {},
   "outputs": [],
   "source": [
    "decoded_wave = decoded.detach().cpu().numpy()\n",
    "first_lead = decoded_wave[0:1000]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ed3e25bc-058c-4212-94e3-7694cf37ee4a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8eb778eb-2f71-454d-ac55-638752afc6f7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "environment": {
   "kernel": "python3",
   "name": "tf2-gpu.2-6.m84",
   "type": "gcloud",
   "uri": "gcr.io/deeplearning-platform-release/tf2-gpu.2-6:m84"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
